package com.xsr.service.impl;

import com.xsr.mapper.UserMapper;
import com.xsr.pojo.User;
import com.xsr.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author 邢式瑞
 * @version 1.0
 * @project peopleThing
 * @date 2022/9/10 17:31
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public boolean findByUsernameAndPwd(String name, String password) {
      User user= userMapper.SelectByNameAndPwd(name,password);
        System.out.println(user);
        if(user!=null){
            return true;
        }
        return false;
    }

    @Override
    public void addUser(User user) {
        userMapper.InsertUser(user);
    }
}
